package com.bruce.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bruce.dao.PermissionDao;
import com.bruce.model.Permission;
import com.bruce.service.PermissionService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@Service
public class PermissionServiceImpl implements PermissionService {

	@Autowired
	private PermissionDao permissionDao;
	
	@Override
	public int insert(Permission impl) {
		// TODO Auto-generated method stub
		return permissionDao.insert(impl);
	}

	@Override
	public int update(Permission impl) {
		// TODO Auto-generated method stub
		return permissionDao.update(impl);
	}

	@Override
    public PageInfo<Permission> selectAll(int pageNum, int pageSize) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, pageSize);
		return new PageInfo<Permission>(permissionDao.selectAll());
	}
	
	@Override
	public int getId(Permission impl) {
		// TODO Auto-generated method stub
		return permissionDao.getId(impl);
	}
}
